<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div class="nav-div clearfix">
    <div class="photo"><img src="image/1535085449773085299.jpg" alt=""></div>
    <div class="nav-wrap">
        <p class="nav-title">慧声FM</p>
        <ul class="nav-ul clearfix">
            <li >
                <a href="home.html">主页</a>
            </li>
            <li>
                <a href="video-album.html">视频专辑</a>
            </li>
            <li>
                <a href="video-page.html">视频</a>
            </li>
            <li>
                <a href="voice-album.html">音频专辑</a>
            </li>
            <li>
                <a href="voice-page.html">音频</a>
            </li>
        </ul>
    </div>
</div>
<script>
    $(function(){
        var list=['home','video-album','video-page','voice-album','voice-page'];

        var url=window.location.href;

        var isFindflag = false;

        for(var i=0;i<list.length;i++){

            if(url.indexOf(list[i]) !== -1){
                $($(".nav-ul li")[i]).addClass('active').siblings().removeClass('active');
                isFindflag = true;
            }else if(url.indexOf('video-play') !== -1){
                $($(".nav-ul li")[2]).addClass('active').siblings().removeClass('active');
                isFindflag = true;
            }else if(url.indexOf('video-album-details') !== -1){
                $($(".nav-ul li")[1]).addClass('active').siblings().removeClass('active');
                isFindflag = true;
            }else if(url.indexOf('voice-album-details') !== -1){
                $($(".nav-ul li")[3]).addClass('active').siblings().removeClass('active');
                isFindflag = true;
            }else if(url.indexOf('voice-details') !== -1){
                $($(".nav-ul li")[4]).addClass('active').siblings().removeClass('active');
                isFindflag = true;
            }
        }
    });

</script>

</body>
</html>